<?php include "block_header.htm";?>

    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a href="">防火墙设置</a>
                <a>
                    <cite>动作设置</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
                <i class="layui-icon" style="line-height:30px">ဂ</i></a>
        </div>
        <div class="x-body">
            <xblock>
                <button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>
                <button class="layui-btn" onclick="x_admin_show('添加规则', 'load.php?url=admin_black_add.htm')"><i class="layui-icon"></i>添加</button>

            </xblock>
            <table class="layui-table">
                <thead>
                    <tr>
                        <th>
                            <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
                        </th>
                        <th>序号</th>

                        <th>名称</th>

                        <th>语言</th>  
                        <th>脚本</th>
                        <th>操作</th> 

                </thead>
                <tbody>


                    <?php foreach ($CONFIG["BLACKLIST"]['black'] as $key => $val): ?>	


                        <tr>
                            <td>
                                <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='<?php echo $key; ?>'><i class="layui-icon">&#xe605;</i></div>
                            </td>
                            <td><?php echo $key; ?>	</td>
                            <td><?php echo $val['name']; ?></td>		

                            <td><?php echo ($val['type'] == 1) ? "PHP" : "HTML"; ?></td>            
                            <td><?php if ($val['type'] == 0) {
                        echo "屏蔽显示请编辑查看内容";
                    } else {
                        echo base64_decode($val['info']);
                    } ?></td>	

                            <td class="td-manage">

                                <a title="编辑"  onclick="x_admin_show('防火墙动作编辑(序号：<?php echo $key; ?>)', 'load.php?url=admin_black_edit.htm&id=<?php echo $key; ?>')" href="javascript:;">
                                    <i class="layui-icon">&#xe642;</i>
                                </a>
                                <a title="删除" onclick="member_del(this, '<?php echo $key; ?>')" href="javascript:;">
                                    <i class="layui-icon">&#xe640;</i>
                                </a>
                            </td>
                        </tr>

<?php endforeach; ?>   

                </tbody>

            </table>


        </div>



        <script>
            layui.use('laydate', function () {
               var laydate = layui.laydate;
                //执行一个laydate实例
               laydate.render({elem: '#start'});
               laydate.render({elem: '#end'});
            });

            /*用户-删除*/
            
            function member_del(obj, id){layer.confirm('确认要删除吗？', function (index){ x_admin_post("admin.php", {"type": "black_black_del", "id": id}); });}
            
           /*用户-删除 多选*/
            function delAll(argument)
            {
            var data = tableCheck.getData(); data = data.join(",");
            layer.confirm('确认要删除吗？' + data, function (index) {x_admin_post("admin.php", {"type": "black_black_del", "id": data}); });
            }
 
        </script>

    </body>

</html>